<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/ui.xhtml">

    <ui:define name="content">

        <h1 class="title ui-widget-header ui-corner-all">Fieldset</h1>
        <div class="entry">
            <p>Fieldset is a pre-skinned grouping component which also provides content toggling and ajax toggleListener as advanced features.</p>

            

            <p:fieldset id="simpleFieldSet" legend="Simple FieldSet">
                <h:panelGrid columns="2" cellpadding="10">
                    <p:graphicImage value="/images/godfather/godfather1.jpg" />
                    <h:outputText
                        value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
                        His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T
                        hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,
                        but given to ruthless violence whenever anything stands against the good of the family." />
                </h:panelGrid>
            </p:fieldset>

            <br /><br />
            <h:form id="form">

                <p:growl id="growl" showDetail="true" />
                
                <p:fieldset id="toggleFieldSet" legend="Toggleable Fieldset" toggleable="true" toggleSpeed="500">
                    <p:ajax event="toggle" listener="#{fieldsetBean.handleToggle}" update="growl" />
                    <h:panelGrid columns="2" cellpadding="10">
                        <p:graphicImage value="/images/godfather/godfather2.jpg" />
                        <h:outputText value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.
                                      In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,
                                      killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."></h:outputText>
                    </h:panelGrid>
                </p:fieldset>

            </h:form>
            <h3>Source</h3>
            <p:tabView>
                <p:tab title="fieldset.xhtml">
                    <pre name="code" class="xml">

&lt;p:fieldset legend="Simple FieldSet"&gt;
    &lt;h:panelGrid columns="2" cellpadding="10"&gt;
        &lt;p:graphicImage value="/images/godfather/godfather1.jpg" /&gt;
        &lt;h:outputText
            value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding.
            His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T
            hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect,
            but given to ruthless violence whenever anything stands against the good of the family." /&gt;
    &lt;/h:panelGrid&gt;
&lt;/p:fieldset&gt;


&lt;h:form&gt;

    &lt;p:growl id="growl" showDetail="true" /&gt;

    &lt;p:fieldset legend="Toggleable Fieldset" toggleable="true" toggleSpeed="500"&gt;
        &lt;p:ajax event="toggle" listener="\#{fieldsetBean.handleToggle}" update="growl" /&gt;
        &lt;h:panelGrid columns="2" cellpadding="10"&gt;
            &lt;p:graphicImage value="/images/godfather/godfather2.jpg" /&gt;
            &lt;h:outputText value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream.
                          In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy,
                          killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/&gt;;
        &lt;/h:panelGrid&gt;
    &lt;/p:fieldset&gt;

&lt;/h:form&gt;
                    </pre>
                </p:tab>

                <p:tab title="FieldsetBean.java">
                    <pre name="code" class="java">
package org.primefaces.examples.view;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.primefaces.event.ToggleEvent;

public class FieldsetBean {

    public void handleToggle(ToggleEvent event) {
        FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Fieldset Toggled", "Visibility:" + event.getVisibility());

        FacesContext.getCurrentInstance().addMessage(null, msg);
    }
}
                    </pre>
                </p:tab>
            </p:tabView>


        </div>

    </ui:define>
</ui:composition>
